//
//  CustomServeViewController.m
//  LOU
//
//  Created by iMacOne on 15/11/6.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "CustomServeViewController.h"
#import "Size.h"
#import "ToolUtil.h"
@interface CustomServeViewController ()
@property (nonatomic, strong)UILabel * firstPhoneLabel;
@property (nonatomic, strong)UILabel * secondPhoneLabel;
@end

@implementation CustomServeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tabBarController.tabBar.hidden = YES;
    [ToolUtil createLine:margin_64 superView:self.view lift:0 width:WindowWidth hight:0.5 color:[UIColor grayColor]];

    [self createTitle:@"我的" midTitle:@"联系客服"];
    [self creatView];
}
- (void)creatView
{
    float y =  [ToolUtil createLine:margin_100 superView:self.view lift:0 width:WindowWidth hight:0.5 color:[UIColor grayColor]];
    self.firstPhoneLabel = [[UILabel alloc] initWithFrame:CGRectMake(margin_10, y + margin_3, WindowWidth / 3 * 2, margin_48)];
    _firstPhoneLabel.font = FONT(14);
    _firstPhoneLabel.userInteractionEnabled = YES;
    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(callMobelPhone)];
    [_firstPhoneLabel addGestureRecognizer:tap];
    
    _firstPhoneLabel.textColor = [UIColor blackColor];
    
    _firstPhoneLabel.text = @"第一个客服电话: 136788899393";
    [self.view addSubview:_firstPhoneLabel];
    
    float yTwo =  [ToolUtil createLine:margin_160 superView:self.view lift:margin_10 width: WindowWidth - margin_10 * 2 hight:0.5 color:[UIColor cyanColor]];
    self.secondPhoneLabel = [[UILabel alloc] initWithFrame:CGRectMake(margin_10, yTwo + margin_3, WindowWidth / 3 * 2, margin_48)];
    _secondPhoneLabel.font = FONT(14);
    _secondPhoneLabel.userInteractionEnabled = YES;
    UITapGestureRecognizer * tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(callMobelPhoneTwo)];
    
    [_secondPhoneLabel addGestureRecognizer:tap1];
    _secondPhoneLabel.textColor = [UIColor blackColor];
    _secondPhoneLabel.text = @"第二个客服电话: 136788899393";
    [self.view addSubview:_secondPhoneLabel];
    [ToolUtil createLine:margin_218 superView:self.view lift:0 width: WindowWidth hight:0.5 color:[UIColor grayColor]];
}
- (void)callMobelPhone
{
    [ToolUtil callPhone:self phone:[_firstPhoneLabel.text substringWithRange:NSMakeRange(9, 11)]];
    NSLog(@"%@",[_firstPhoneLabel.text substringWithRange:NSMakeRange(9, 11)]);
}
- (void)callMobelPhoneTwo
{
    NSLog(@"fd");
}
@end
